﻿using CPPEI.Win32;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TestCaptureScreen
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        WindowsScreen ws;
        public MainWindow()
        {
            InitializeComponent();
            ws = new WindowsScreen(1024, 768);
        }

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            byte[] data = ws.Capture(0, 0, 1024, 768);

            Debug.WriteLine("data.length:{0}", data.Length);
            byte[] cdata = GZip.Compress(data);

            Debug.WriteLine("cdata.length:{0}", cdata.Length);

            //for (int index = 0; index < 2; index++)
            //{
            //    //int x = index * 100;
            //    //int y = 0;
            //    //byte[] data = WindowsScreen.Capture(x, y, 100, 100);

            //    //this._renderView.Update(x, y, 100, 100, 100, 100, data);
            //    int x = index * 400;
            //    int y = 0;
            //    byte[] data = WindowsScreen.Capture(x, y, 400, 400);

            //    this._renderView.Update(x, y, 400, 400, 400, 400, data);
            //}
        }
    }
}
